﻿@using CkSoftware.GroupMe.Sdk.TestWeb.Models
@using TwitterBootstrapMVC.Controls
@model ClientAuthConfigurationModel
@{
    ViewBag.Title = "Client authentication example";
}

<div class="page-header">
    <h1>Client authentication example</h1>
</div>

<p>Here you can test the client authentication helper class.</p>

<h2>Application configuration</h2>
<p>To authorize a client, first you need to provide a client-id of your application. This client-id can be obtained on the <a href="https://dev.groupme.com/applications">GroupMe applications page</a>.</p>
<p>There you need to click on the desired application (or create one if there is currently no application available) and copy the client-id part of the displayed Redirect URL.</p>

<div class="alert alert-info">
    <strong>Information:</strong>
    The best way to test the authentication is to set the callback url in your application settings to this: <strong>@(Model.RecommendedUrl)</strong>. This way, the test-web can handle the callback correctly.
</div>

@using (FormBuilder<ClientAuthConfigurationModel> form = Html.Bootstrap().Begin(new Form("ConfigureClientAuth").Type(FormType.Horizontal)))
{
    @form.ControlGroup().TextBoxFor(m => m.ClientId).Label().LabelText("Application client id")
    @form.ControlGroup().CustomControls(Html.Bootstrap().SubmitButton())
}
